package ua.org.enginer.utils.time {
	
	public function parseTimestamp(timestamp:String):Date {
		
		var splited:Array = timestamp.split(" ");
        var date:String = splited[0];
        var time:String;
        
        if(splited[1]) {
        	time = splited[1];
        }else {
        	time = "00:00:00";
        }
        
        var dateArray:Array = date.split("-");
        var timeArray:Array = time.split(":");

        return new Date(Number(dateArray[0]),Number(dateArray[1])-1,Number(dateArray[2]),
        	Number(timeArray[0]),Number(timeArray[1]),Number(timeArray[2]));
	}
}